Unreferenced function in 2.4.4 Linux build
In file comp-lz4.c, g++ flags LZ4_compress_default as unreferenced and the build fails.
Hi,
Quoted 2 lines · On Fri, Sep 29, 2017 at 09:34:36PM -0400, [email protected]... wrote:
In file
comp-lz4.c, g++ flagsLZ4_compress_defaultas unreferenced and the build fails.
Why are you building with g++? This is not something we regularily do, test, or recommend.
But besides this, this sounds like your system lz4 library is too old, and our configure test is not catching this - LZ4_compress_default() is, basically, the new name for an old function. If the system library does not provide it (LZ4_VERSION_NUMBER < 10701L, which is "lz4 1.7.1") we should fall back to src/compat/compat-lz4.c which has it.
Which linux distribution is this, in which version? Can you upload config.log and your system's "lz4.h" somewhere so we can see what it tried to do, and why it is failing?
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Hi,
(copying back in the list)
Quoted 3 lines · Gert Doering
Which linux distribution is this, in which version? Can you upload config.log and your system's "
lz4.h" somewhere so we can see what it tried to do, and why it is failing?
I received the files in the meantime, and I'm not fully understanding the issue yet.
lz4.h says it's 1.8.0, so is passing the "newer than 1.7.1" check just fine. The lz4.h also has a prototype for LZ4_compress_default(), so it really should work fine...
What I noticed in config.log is that we test for "is it working?" by checking LZ4_compress()
# if LZ4_LIBS is set, we assume it will work, otherwise test
if test -z "${LZ4_LIBS}"; then
AC_CHECK_LIB([lz4],
[LZ4_compress],
[LZ4_LIBS="-llz4"],
[have_lz4="no"])
fi... which we might want to change to LZ4_compress_default().
But it should still work.
@logcabin: can you show me the failing compiler call as well? Like, the last 30 lines from a failing "make" run?
You said you found a workaround for it - what did you do to fix it?
Could it be that there are multiple liblz4.a or liblz4.so.* on your system? What does "locate liblz4." print out?
(So maybe there's a lz4.h for 1.8.0, but the liblz4.* that the linker picks up is from an older version that did not have LZ4_compress_default() yet...)
Slightly puzzling :-)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Yes, I saw the prototype for LZ4_compress_default(), but I was unable to find the function itself. Here's the error output from the make command:
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I../../src/compat -DPLUGIN_LIBDIR=\"/usr/local0/lib/openvpn/plugins\" -g -O2 -std=c99 -MT comp-lz4.o -MD -MP -MF .deps/comp-lz4.Tpo -c -o comp-lz4.o comp-lz4.c mv -f .deps/comp-lz4.Tpo .deps/comp-lz4.Po/bin/bash ../../libtool --tag=CC --mode=link gcc
-DPLUGIN_LIBDIR=\"/usr/local0/lib/openvpn/plugins\" -g -O2 -std=c99 -o openvpn argv.o base64.o buffer.o clinat.o comp.o compstub.o comp-lz4.o crypto.o crypto_openssl.o crypto_mbedtls.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o platform.o console.o console_builtin.o console_systemd.o mroute.o mss.o mstats.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o pkcs11_openssl.o pkcs11_mbedtls.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o ssl_openssl.o ssl_mbedtls.o ssl_verify.o ssl_verify_openssl.o ssl_verify_mbedtls.o status.o tls_crypt.o tun.o win32.o cryptoapi.o ../../src/compat/libcompat.la -lnsl -lresolv -llzo2
-llz4 -lssl -lcrypto -ldl
libtool: link: gcc -DPLUGIN_LIBDIR=\"/usr/local0/lib/openvpn/plugins\" -g -O2 -std=c99 -o openvpn argv.o base64.o buffer.o clinat.o comp.o compstub.o comp-lz4.o crypto.o crypto_openssl.o crypto_mbedtls.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o platform.o console.o console_builtin.o console_systemd.o mroute.o mss.o mstats.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o pkcs11_openssl.o pkcs11_mbedtls.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o ssl_openssl.o ssl_mbedtls.o ssl_verify.o ssl_verify_openssl.o ssl_verify_mbedtls.o status.o tls_crypt.o tun.o win32.o cryptoapi.o ../../src/compat/.libs/libcompat.a -lnsl -lresolv -llzo2 -llz4 -lssl -lcrypto -ldl
comp-lz4.o: In function `do_lz4_compress':/root/openvpn-2.4.4/src/openvpn/comp-lz4.c:90: undefined reference to `LZ4_compress_default'
collect2: error: ld returned 1 exit status
Here's the output from the locate command:
/usr/lib/arm-linux-gnueabihf/liblz4.a/usr/lib/arm-linux-gnueabihf/liblz4.so/usr/lib/arm-linux-gnueabihf/liblz4.so.1/usr/lib/arm-linux-gnueabihf/liblz4.so.1.3.0/usr/lib/arm-linux-gnueabihf/pkgconfig/liblz4.pc/usr/local/lib/liblz4.a/usr/local/lib/liblz4.so/usr/local/lib/liblz4.so.1/usr/local/lib/liblz4.so.1.8.0/usr/local/lib/pkgconfig/liblz4.pc
Since I could not locate LZ4_compress_default() in the openvpn source, I pulled lz4.c from the lz4 source tree, snipped out that function from the file, and then inserted it into comp_lz4.c. This does not work because there are many dependencies in this function.
So I made a horrible hack and simply included lz4.c in comp_lz4.c. This solved the dependencies, but is most likely the wrong way to solve this problem :-)
Quoted 61 lines · Gert Doering
Hi,
(copying back in the list)
Quoted 3 lines · Gert Doering
Which linux distribution is this, in which version? Can you upload config.log and your system's "
lz4.h" somewhere so we can see what it tried to do, and why it is failing?I received the files in the meantime, and I'm not fully understanding the issue yet.
lz4.hsays it's 1.8.0, so is passing the "newer than 1.7.1" check just fine. Thelz4.halso has a prototype forLZ4_compress_default(), so it really should work fine...What I noticed in config.log is that we test for "is it working?" by checking
LZ4_compress()# if LZ4_LIBS is set, we assume it will work, otherwise test if test -z "${LZ4_LIBS}"; then AC_CHECK_LIB([lz4], [LZ4_compress], [LZ4_LIBS="-llz4"], [have_lz4="no"]) fi... which we might want to change to
LZ4_compress_default().But it should still work.
@logcabin: can you show me the failing compiler call as well? Like, the last 30 lines from a failing "make" run?
You said you found a workaround for it - what did you do to fix it?
Could it be that there are multiple liblz4.a or liblz4.so.* on your system? What does "locate liblz4." print out?
(So maybe there's a
lz4.hfor 1.8.0, but the liblz4.* that the linker picks up is from an older version that did not haveLZ4_compress_default()
yet...)Slightly puzzling :-)
gert
Signature · 9 lines
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany [email protected]... fax: +49-89-35655025 [email protected]... Email had 1 attachment: + signature.asc 1k (application/pgp-signature)
Hi,
Quoted 12 lines · On Sat, Sep 30, 2017 at 02:08:19PM -0400, [email protected]... wrote:
Here's the output from the locate command:
/usr/lib/arm-linux-gnueabihf/liblz4.a/usr/lib/arm-linux-gnueabihf/liblz4.so/usr/lib/arm-linux-gnueabihf/liblz4.so.1/usr/lib/arm-linux-gnueabihf/liblz4.so.1.3.0/usr/lib/arm-linux-gnueabihf/pkgconfig/liblz4.pc/usr/local/lib/liblz4.a/usr/local/lib/liblz4.so/usr/local/lib/liblz4.so.1/usr/local/lib/liblz4.so.1.8.0/usr/local/lib/pkgconfig/liblz4.pc
This is likely the issue here. You have a very old version in the system linking path (1.3.0), and a recent version in /usr/local/lib/ - but to use that, the compiler would need a "-L/usr/local/lib" directive.
Unfortunately, even if our configure script had checked for the LZ4_compress_default() function, it might have still bombed later, as "which -I and -L directives end up in the final compile/link call" is not always those that are used for a certain test.
Quoted 1 line
Since I could not locate
LZ4_compress_default()in the openvpn source, I
e pulled lz4.c from the lz4 source tree, snipped out that function from
Quoted 6 lines
the file, and then inserted it into
comp_lz4.c. This does not work because there are many dependencies in this function.So I made a horrible hack and simply included
lz4.cincomp_lz4.c. This solved the dependencies, but is most likely the wrong way to solve this problem :-)
Well, it is :-) - the "best" way might have been to explicitely tell configure where to find the new library
./configure LZ4_CFLAGS=-I/usr/local/include LZ4_LIBS="-L/usr/local/lib -llz4"
(the quote "" characters are needed due to the "-l").
Alternatively, rename the system "lz4.h" before running configure, in which case OpenVPN will fall back to using its own copy, bundled in src/compat/compat-lz4*.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...This has solved the problem:
./configure LZ4_CFLAGS=-I/usr/local/include LZ4_LIBS="-L/usr/local/lib -llz4"
My mistake was to assume that since ./configure had found LZ4 version >= 1.7.1, it would also locate the latest lz4 library. My bad.
Thanks for all your help!
Quoted 59 lines · Gert Doering
Hi,
Quoted 12 lines · On Sat, Sep 30, 2017 at 02:08:19PM -0400, [email protected]... wrote:
Here's the output from the locate command:
/usr/lib/arm-linux-gnueabihf/liblz4.a/usr/lib/arm-linux-gnueabihf/liblz4.so/usr/lib/arm-linux-gnueabihf/liblz4.so.1/usr/lib/arm-linux-gnueabihf/liblz4.so.1.3.0/usr/lib/arm-linux-gnueabihf/pkgconfig/liblz4.pc/usr/local/lib/liblz4.a/usr/local/lib/liblz4.so/usr/local/lib/liblz4.so.1/usr/local/lib/liblz4.so.1.8.0/usr/local/lib/pkgconfig/liblz4.pcThis is likely the issue here. You have a very old version in the system linking path (1.3.0), and a recent version in
/usr/local/lib/- but
to use that, the compiler would need a "-L/usr/local/lib" directive.Unfortunately, even if our configure script had checked for the
LZ4_compress_default()function, it might have still bombed later, as "which -I and -L directives end up in the final compile/link call" is not always those that are used for a certain test.Quoted 1 line
Since I could not locate
LZ4_compress_default()in the openvpn source, Ie pulled
lz4.cfrom the lz4 source tree, snipped out that function fromQuoted 6 lines
the file, and then inserted it into
comp_lz4.c. This does not work because there are many dependencies in this function.So I made a horrible hack and simply included
lz4.cincomp_lz4.c. This solved the dependencies, but is most likely the wrong way to solve this problem :-)Well, it is :-) - the "best" way might have been to explicitely tell configure where to find the new library
./configure LZ4_CFLAGS=-I/usr/local/include LZ4_LIBS="-L/usr/local/lib -llz4"
(the quote "" characters are needed due to the "-l").
Alternatively, rename the system "
lz4.h" before running configure, in which case OpenVPN will fall back to using its own copy, bundled in src/compat/compat-lz4*.gert
Signature · 9 lines
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany [email protected]... fax: +49-89-35655025 [email protected]... Email had 1 attachment: + signature.asc 1k (application/pgp-signature)
Hi,
Quoted 7 lines · On Sat, Sep 30, 2017 at 02:56:25PM -0400, [email protected]... wrote:
This has solved the problem:
./configure LZ4_CFLAGS=-I/usr/local/include LZ4_LIBS="-L/usr/local/lib -llz4"
My mistake was to assume that since ./configure had found LZ4 version >= 1.7.1, it would also locate the latest lz4 library. My bad.
Just as a small followup - we've discovered that this was not (only) a problem of your installation, but hit all Debian 8 systems.
We have adjusted our "configure" script to check for this particular problem (the version number reported is "130", which is "greater than 1.7.1", but actually a very old version), so 2.4.5 should build out of the box just fine.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Thanks for the followup - I checked out the source from the master branch and it builds with no problems.
Looking forward to 2.4.5!
Quoted 32 lines · Gert Doering
Hi,
Quoted 7 lines · On Sat, Sep 30, 2017 at 02:56:25PM -0400, [email protected]... wrote:
This has solved the problem:
./configure LZ4_CFLAGS=-I/usr/local/include LZ4_LIBS="-L/usr/local/lib -llz4"
My mistake was to assume that since ./configure had found LZ4 version >= 1.7.1, it would also locate the latest lz4 library. My bad.
Just as a small followup - we've discovered that this was not (only) a problem of your installation, but hit all Debian 8 systems.
We have adjusted our "configure" script to check for this particular problem (the version number reported is "130", which is "greater than 1.7.1",
but actually a very old version), so 2.4.5 should build out of the box just fine.gert
Signature · 9 lines
USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany [email protected]... fax: +49-89-35655025 [email protected]... Email had 1 attachment: + signature.asc 1k (application/pgp-signature)
This is really disgusting after unsubscribe again and againg still getting messgs, what the f*** who is admin plz help here.
Quoted 12 lines · On 30-Sep-2017 7:22 AM, <[email protected]...> wrote:
In file
comp-lz4.c, g++ flagsLZ4_compress_defaultas unreferenced and the build fails.------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel